package com.yituo.mjworld.mvc.entity.web;

import com.yituo.mjworld.core.annotation.Rules;
import com.yituo.mjworld.core.web.core.BaseForm;

import javax.persistence.*;

@Entity
@Table(name = "web_img_arr", schema = "web_mojianworld_server", catalog = "")
public class WebImgArr extends BaseForm {
  @Rules(id = true)
  public int id;
  @Rules(fieldName = "产品ID", min = "0")
  public Integer productId;
  @Rules(fieldName = "URL1", required = false)
  public String imgUrl1;
  @Rules(fieldName = "URL2", required = false)
  public String imgUrl2;
  @Rules(fieldName = "URL3", required = false)
  public String imgUrl3;
  @Rules(fieldName = "URL4", required = false)
  public String imgUrl4;
  @Rules(fieldName = "URL5", required = false)
  public String imgUrl5;

  @Id
  @Column(name = "id", nullable = false)
  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  @Basic
  @Column(name = "productId", nullable = true)
  public Integer getProductId() {
    return productId;
  }

  public void setProductId(Integer productId) {
    this.productId = productId;
  }

  @Basic
  @Column(name = "imgUrl1", nullable = true, length = 100)
  public String getImgUrl1() {
    return imgUrl1;
  }

  public void setImgUrl1(String imgUrl1) {
    this.imgUrl1 = imgUrl1;
  }

  @Basic
  @Column(name = "imgUrl2", nullable = true, length = 100)
  public String getImgUrl2() {
    return imgUrl2;
  }

  public void setImgUrl2(String imgUrl2) {
    this.imgUrl2 = imgUrl2;
  }

  @Basic
  @Column(name = "imgUrl3", nullable = true, length = 100)
  public String getImgUrl3() {
    return imgUrl3;
  }

  public void setImgUrl3(String imgUrl3) {
    this.imgUrl3 = imgUrl3;
  }

  @Basic
  @Column(name = "imgUrl4", nullable = true, length = 100)
  public String getImgUrl4() {
    return imgUrl4;
  }

  public void setImgUrl4(String imgUrl4) {
    this.imgUrl4 = imgUrl4;
  }

  @Basic
  @Column(name = "imgUrl5", nullable = true, length = 100)
  public String getImgUrl5() {
    return imgUrl5;
  }

  public void setImgUrl5(String imgUrl5) {
    this.imgUrl5 = imgUrl5;
  }

  @Override
  public int hashCode() {
    int result = id;
    result = 31 * result + (productId != null ? productId.hashCode() : 0);
    result = 31 * result + (imgUrl1 != null ? imgUrl1.hashCode() : 0);
    result = 31 * result + (imgUrl2 != null ? imgUrl2.hashCode() : 0);
    result = 31 * result + (imgUrl3 != null ? imgUrl3.hashCode() : 0);
    result = 31 * result + (imgUrl4 != null ? imgUrl4.hashCode() : 0);
    result = 31 * result + (imgUrl5 != null ? imgUrl5.hashCode() : 0);
    return result;
  }

  @Override
  public boolean validate() {
    return defaultValidate();
  }
}
